﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;

namespace LayuiTemplate.Control
{
    public  class LayErrorMsgTextBox:TextBox
    {
        public double TextBoxWidth 
        {
            get { return (double)GetValue(TextBoxWidthProperty); }
            set { SetValue(TextBoxWidthProperty, value); }
        }

        public static readonly DependencyProperty TextBoxWidthProperty = DependencyProperty.Register("TextBoxWidth",typeof(double),typeof(LayErrorMsgTextBox),new PropertyMetadata());

        public double TextBoxHeight 
        {
            get { return (double)GetValue(TextBoxHeightProperty); }
            set { SetValue(TextBoxHeightProperty, value); }
        }
        public static readonly DependencyProperty TextBoxHeightProperty = DependencyProperty.Register("TextBoxHeight", typeof(double), typeof(LayErrorMsgTextBox), new PropertyMetadata());


        public double ErrorMsgFontSize 
        {
            get { return (double)GetValue(ErrorMsgFontSizeProperty); }
            set { SetValue(ErrorMsgFontSizeProperty, value); }
        }
        public static readonly DependencyProperty ErrorMsgFontSizeProperty = DependencyProperty.Register("ErrorMsgFontSize",typeof(double),typeof(LayErrorMsgTextBox),new PropertyMetadata());


        public bool ErrorMsgVisible 
        {
            get { return (bool)GetValue(ErrorMsgVisibleProperty); }
            set { SetValue(ErrorMsgVisibleProperty, value); }   
        }
        public static readonly DependencyProperty ErrorMsgVisibleProperty = DependencyProperty.Register("ErrorMsgVisible",typeof(bool),typeof(LayErrorMsgTextBox),new PropertyMetadata());

        public Brush ErrorMsgForeground 
        {
            get { return (Brush)GetValue(ErrorMsgForegroundProperty); }
            set { SetValue(ErrorMsgForegroundProperty, value); }
        }
        public static readonly DependencyProperty ErrorMsgForegroundProperty = DependencyProperty.Register("ErrorMsgForeground",typeof(Brush),typeof(LayErrorMsgTextBox),new PropertyMetadata());

        //errorMsg
        public string ErrorMsg 
        {
            get { return (string)GetValue(ErrorMsgProperty); }
            set { SetValue(ErrorMsgProperty, value); }
        }
        public static readonly DependencyProperty ErrorMsgProperty = DependencyProperty.Register("ErrorMsg",typeof(string),typeof(LayErrorMsgTextBox),new PropertyMetadata(ErrorMsgPropertyChange));

        private static void ErrorMsgPropertyChange(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            
        }
    }
}
